<template>
  <el-dialog title="查看" :width="width"
             :visible.sync="isShowVisible"
             center :close-on-click-modal="true"
             :before-close="() => this.close()">
    <el-card>
      <el-form label-width="105px" :model="data" ref="data" v-loading="isLoading">
        <el-row>
            <el-form-item label="流程KEY:" prop="fflowkey" >
              <el-input v-model="data.fflowkey" :disabled="true"></el-input>
            </el-form-item>
        </el-row>
        <el-row>
            <el-form-item label="实例KEY:" prop="finstancekey" >
              <el-input v-model="data.finstancekey" :disabled="true"></el-input>
            </el-form-item>
        </el-row>
        <el-row>
            <el-form-item label="执行结果:" prop="fstatus" >
                 <el-tag v-if="data.fstatus==1" type="success" :disabled="true">成功</el-tag>
                 <el-tag v-if="data.fstatus==0" type="danger" :disabled="true">失败</el-tag>
            </el-form-item>
        </el-row>
        <el-row>
            <el-form-item label="创建时间:" prop="fcreatetime" >
              <el-input v-model="data.fcreatetime" :disabled="true"></el-input>
            </el-form-item>
        </el-row>
        <el-row>
             <el-form-item label="输入参数:" prop="fparam" >
              <el-input type="textarea" :rows="8" v-model="data.fparam" :disabled="true"></el-input>
            </el-form-item>
        </el-row>
        <el-row>
             <el-form-item label="错误信息:" prop="ferror" >
              <el-input type="textarea" :rows="8" v-model="data.ferror" :disabled="true"></el-input>
            </el-form-item>
        </el-row>
      </el-form>
    </el-card>
  </el-dialog>
</template>

<script>
  import LogBaseApi from '@/api/module/LogBaseApi'
  export default {
    name: 'flowlog_view',
    props:{
      width : {type : String , default : '40vw'},
      fid : {type : Number , },
    },
    data(){
      return{
        isShowVisible : true,
        isLoading : false,
        data : {},
        api : new LogBaseApi(),
      }
    },
    mounted(){
    },
    async created(){
      this.isLoading = true
      let data = await this.api.detail({fid:this.fid});
      this.data =  data.data
      this.isLoading = false
    },
    methods:{
      close(){
        this.$emit('close')
      }
    },
  }
</script>
<style scoped>
</style>
